#include<bits/stdc++.h>

using namespace std;
int main()
{
	int n, m, nm;
	cin >> n >> m ;
	vector<int> arr;
	for (int i = 0; i < m; i++) {
		cin >> nm;
		arr.push_back(nm);
	}
	sort(arr.begin(), arr.end());
	for (auto x : arr) {
		cout << x << " " ;
	}
	return 0;
}
